package com.example.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.example.mybatisplus.pojo.Other;
import org.apache.ibatis.annotations.*;


@Mapper
public interface OtherMapper extends BaseMapper<Other> {
    @Results(id="otherResultMap",value = {
        @Result(id=true,column = "id",property = "id"),
        @Result(column ="other_name",property = "otherName"),
        @Result(column = "other_create_time",property = "otherCreateTime")
    })
    @Select("select * from other where id=#{id}")
    public Other selectById(long id);

    @ResultMap(value = "otherResultMap")
    @Select("select * from other where other_name=#{name}")
    public Other selectByName(String name);




    @Insert("insert other values(#{et.id},#{et.otherName},#{et.otherCreateTime})")
    public int insertOne(@Param(Constants.ENTITY) Other other);
}
